RAM:
$0090 = pointer storage
$00A0-00A2 = dialogue box graphics
$00B0,$00B4 = pointer storage
$00B2,$00B6 = long-pointer storage
$00D0-$0100: MISC
	$00F0 = state
		00 = screen transition
		01 = normal
		02 = menu
		03 = y/n prompt
		04 = dialogue
		05 = room transition
	$00F1 = dpad input (02 = up, 03 = down, 04 = left, 05 = right)
	$00F2 = screen rotation (1st-person)
	$00FB = player direction
		00 = N
		01 = E
		02 = S
		03 = W
	$00FD = area tileset
		06 = Center/Eden
$0300-$037A: CHARACTER NAMES, CURRENCY, VARIOUS
	$0305-0308 = MACCA
	$0309-030C = MAGNETITE
		For both of these, 4th byte is read but will cause the display to glitch because it contains more digits than the display has.
	$030F = MOON PHASE
		Only the first nibble seems to matter.
	$0310-$033F = NAMES
		(must terminate with FF for endstring)
		310 = Aleph
		318 = Hiroko
		320 = Beth
		328 = Gimmel
		330 = Daleth
		338 = Zayin
		340 = Aleph (2)
	$0356 = screen effect
		01 = blur
		02 = fade out
		03 = blur + fade out
		04 = shake
		$0357-035B are related
	$0360 = ???
		constantly incremented in Cathedral of Shadows, change causes ACE
	$0362-0365 = coins
	$0380: temp storage
	$03AC: moon phase?
	$03AD: related to time progression?
		decremented when moon phase changes
	$03F9-03FB used for RNG
$0400-$04FF: POSITION & INVENTORY
	$0400-040A = party positions (actual)
	$040C-0416 = party positions (in Change menu)
	$0418 = PLAYER X-COORD
	$0419 = PLAYER Y-COORD
	$041A = area tileset (written to $00FD)
	$0420-043F = KEY ITEMS
	$0440-045F = ITEMS
	$0460-047F = ITEM AMTs
	$0480-049F = PARTNER SPELLS
	$04A0-04BF = ???
	$04C0-04CF = COMP OPTIONS (?)
	$04E0-04EB = GEMS
	$04C0-04FF = ???
$051B: stores current instruction during event sequences
$0554: stores current shop ID
$0566: active item
$0567: if not 0, active item is a key item or gem
$056A-$056D: some relation to alignment shifts
	called when drawing sprites?
$056F-$0573: active demons (?)
	used during fusion calculations and adding demons to party
$0608-$060C: ???
	$060C mirrors coins from $0362 during item exchange
	$060B written to during Code Breaker and Casino games
$0638-$063D: temp storage (usually core stats?)
$0808-$080C: temp storage
$0E00-$0E1F: Event flags
	$0E00:
		#1 = timer expired?
		#2 = doing virtual training
		#4 = initial training done
		#8 = received Demon Summoning Program
		1# = Hiroko named
		2# = Gimmel named
		4# = Zayin named
		8# = saw Okamoto @ casino
	$0E01:
		#1 = to Colosseum
		#2 = defeated Red Bear
		#4 = received Madam's invitation
		#8 = Beth named
		1# = Madam first meeting done
		2# = defeated Mercurius (Hanada dead)
			(at least, that's what branch logic seems to imply, but I can't find the setter in Hanada's death scene)
		4# = returned to Madam from Hanada, met Zayin
		8# = met Center Bishop
			skips naming if active (probably since you can now access the labs)
	$0E02:
		#1 = met Center Bishop
		#2 = defeated King Frost
		#4 = defeated Basilisk
		#8 = Holytown quest done
		1# = Holytown donations complete
		2# = Holytown church complete
		4# = started Factory quest
		8# = defeated Betelgeuse
	$0E03:
		#1 = stopped rampaging Demi-Nandis
		#2 = have Arcadia access
		#4 = in Arcadia
		#8 = met Gimmel
		1# = Daleth rescued Holytown woman's sister
		2# = Daleth issued challenge
		4# = defeated Daleth @ Colosseum
		8# = met Mekata
	$0E04:
		#1 = have Nadja
		#2 = defeated Janus
		#4 = defeated Zayin @ prison
		#8 = Hiroko freed
		1# = Nadja fused w/ Hiroko
		2# = informed by Zayin about Abaddaon
		4# = met Cerberus after Valhalla swallowed
		8# = defeated Daleth 2
			checked upon entering Terminal (why?)
	$0E05:
		#1 = Hiroko left with Daleth
		#2 = Anoon offered to entreat Oberon to break love spell
		#4 = Oberon directed you to Puck
		#8 = offered to buy Infidelilly Sap, but couldn't pay
		1# = love spell broken
		2# = Anoon seduced Daleth
		4# = Masakado quest begun
			Holytown church permanently failed if not complete before this
		8# = revived Kotoshironushi
	$0E06:
		#1 = defeated Baphomet
		#2 = entered O-yamatsumi's shrine
		#4 = got O-yamatsumi
		#8 = entered Sukuna-hikona's shrine
		1# = got Sukuna-hikona
		2# = fused Masakado
		4# = resurrected Masakado
		8# = opened Sealed Cavern
	$0E07:
		#1 = freed Amaterasu
		#2 = freed Tsukuyomi
		#4 = freed Take-mikazuchi
		#8 = freed Omoikane
		1# = freed Tajikarao
		2# = freed Amatsukami
		4# = Zayin attempts jailbreak
		8# = seen that prisoners refuse freedom
	$0E08:
		#1 = Gou Mifune freed
		#2 = failed to open Abyss portal / seen Gomory's intro in Ark Terminal (Chaos route)
			(replaces the pentagram with a broken portal sprite)
		#4
		#8 = Zayin attempted to free prisoners, directed to watchtower
		1# = passed watchtower gate
		2# = Zayin warned you about Belphegor
		4# = defeated Belphegor
		8# = opened Abyss portal with dolls
	$0E09:
		#1 = found Petersen
		#2 = Siren rescued
		#4 = freed prisoner 1
		#8 = ...2
		1# = ...3
		2# = ...4
		4# = defeated Gimmel
		8# = Aleph controls Arcadia
	$0E0A:
		#1 = Arcadia destroyed
		#2 = seen Bishop deliver ultimatum to Zayin
			Thomas Tank dies when this is set
		#4 = Zayin goes to Center
		#8 = spoken to Gabriel
		1# = spoken to Gate of Judgment
		2# = defeated archangels
		4# = @ Okamoto's trainer
		8# = @ Valhalla trainer
	$0E0B:
		#1 = @ Valhalla trainer (the better one)
		#2 = @ Center trainer
		#4 = @ Holytown trainer
		#8 = @ Underworld trainer
		1# = Abyss gate opened
			(disables backdoor portals)
		2# = heard Mekata's truth
		4# = Law route
		8# = Chaos route
	$0E0C:
		#1 = passed Cherubim, can enter Eden
		#2 = met Gomory
		#4
		#8 = Gomory scene (confirms you are not Satan, Gabriel takes you to Eden)
		1# = Set awakened
		2# = defeated Kuzuryu
		4# = heard Zayin speech about Factory
		8# = got Infidelilly Sap from Puck
	$0E0D:
		#1 = Moloch appeared
		#2 = Abyss gate opened
		#4 = placed Moon Pillar
		#8 = placed Mars Pillar
		1# = placed Mercury Pillar
		2# = placed Jupiter Pillar
		4# = placed Venus Pillar
		8# = placed Saturn Pillar
	$0E0E:
		#1 = Pillars placed
		#2 = defeated Hecate
		#4 = defeated Atavaka
		#8 = defeated Master Therion
		1# = Yetzirah Corridor unlocked
		2# = defeated Abaddon
		4# = saw Madam in Abaddon
		8#
	$0E0F:
		#1 = defeated Astaroth
			(Arcadia residents die if Arcadia destroyed)
		#2 = met Lucifer (Louis Cyphre unmasked)
		#4 = Neutral route?
		#8 = Satan appeared
		1# = have Satan?
		2# = have Lucifer
		4# = defeated Tiamat
		8#
	$0E10: Holytown church progress / Shinshou defeats
		(all of these are unset upon accepting Masakado quest to make room for Shinshou)
		#1 = 1 donation / defeated Vikarala
		#2 = 2 / defeated Catura
		#4 = 3 / defeated Shindura
		#8 = 4 / defeated Makura
		1# = 5 / defeated Pajira
		2# = 6 / defeated Indara
		4# = 7 / defeated Sandira
		8# = 8 / defeated Majira
	$0E11:
		#1 = 9 donations / defeated Andira
		#2 = defeated Mihira
		#4 = defeated Vajra
		#8 = defeated Kumbhira
		1# = spoke with Virocana (Chaos route)
		2# = defeated Virocana
		4# = saw Beth's ghost
		8# = Astaroth separated
	$0E12:
		#1 = got Fury's Robe
		#2 = returned Fury's Robe
		#4 = defeated Sarutahiko
		#8 = defeated/passed Mara
		1# = Mara's test (Chaos route)
		2# = Kether Castle gate opened w/ Masakado's katana (got Hihiirokane)
		4# = defeated Lucifer
		8# = defeated Sabaoth
	$0E13:
		#1 = defeated Shaddai
		#2 = defeated Elohim
		#4 = defeated Beelzebub
		#8 = defeated Satan
		1# = Kuzuryu awakened
		2# = Megido Ark fired
		4# = got Cerberus from Madam
		8# = Satan waiting to join (stock full)
	$0E14:
		#1
		#2 = heard YHVH preamble 1
		#4 = ...2
		#8 = ...3
		1# = met Lucifuge
		2# = won Holytown dance competition
		4# = seen Zayin's broadcast
		8# = won Holytown dance competition twice
	$0E15:
		#1 = Lucifer waiting to join (stock full)
		#2 = dwarves forging Hihiirokane
		#4 = Masakado's Sword ready
		#8 = forged Masakado's Sword
		1#
		2# = saw Mekata & Hanada flashback
		4# = epilogue?
		8# = heard Hiruko's story
	$0E16:
		#1 = portal: did not use Laughing Doll
		#2 = portal: did not use Crying Doll
		#4 = portal: did not use Angry Doll
		#8 = visited Holytown item shop
			related to Pillar quest?
		1#
		2# = Terminal Stones usable
		4# = have item/spell analyzer
		8# = Beth present?
			set before fighting Zayin @ prison, but unset immediately after
	$0E17:
		#1
		#2 = casino?
		#4 = casino?
		#8
		1# = current casino uses Dark Coins
		2# = current casino uses Gold Coins
		4# = teleported to Ark (Neutral)
		8#
	$0E18:
		#1 = cleared Shinshou dungeon
		#2 = rescued O-yamatsumi
		#4 = rescued Sukuna-hikona
		#8 = Holytown dance competition active
		1# = visited Fiend location
		2# = Set stirs
		4# = Ending montage
			unset after montage done
		8#
	$0E19:
		#1 = unset after freeing Hiroko
		#2
		#4 = did Russian Roulette
			unset on save
		#8
		1# = spoke to Lucifer @ Kether (Chaos route, but *not* recruitment branch)
		2# = Kuzuryu done
		4# = set after opening Abyss portal
			unset after recruiting Lucifer on Chaos
			unset after defeating Kuzuryu on Neutral
		8#
	$0E1A:
		#1 = set after freeing Hiroko
		#2 = set after freeing Hiroko
			unset when using specific Terminal
		#4 = related to Kuzuryu?
		#8 = met Lucifuge (skips Lucifuge if set?)
		1#
		2#
		4#
		8#
	$0E1B:
		#1
		#2
		#4
		#8
		1#
		2#
		4#
		8#
	$0E1C:
		#1 = route chosen
			also set if used default name?
		#2
		#4
		#8
		1#
		2# = received Devil Analyzer
		4# = received stock upgrade 1
		8# = received stock upgrade 2
	$0E1D:
		#1 = seen Steven in VR
		#2 = seen Steven in VR (?)
		#4 = met Louis Cyphre
		#8 = passed INT check to enter watchtower
			also checked after freeing Hiroko
		1#
		2# = let Puck run away
		4# = game clear
			used to unlock Kongokai, so presumably preserved across saves
		8# = spoken to barfly w/ Siren info
	$0E1E:
		#1 = unset after freeing Hiroko
		#2 = unset after freeing Hiroko
		#4
		#8
		1# = unset on save when Arcadia destroyed
		2# = unset after Megido Ark fires
		4# = unset after Megido Ark
		8# = unset after Megido Ark
	$0E1F:
		#1 = unset after Megido Ark fires
		#2 = unset after Megido Ark
		#4 = unset after Megido Ark
		#8
		1#
		2#
		4#
		8# = defeated YHVH
		
$1000-$153F: CHARACTER DATA
	00 = PARTY STATUS
		##80 = in storage
		##C0 = in active party	
		##00 = absent
	02 = STATUS (low & high nibbles are independent)
		01 = CURSE
		02 = CLOSE
		04 = POISON
		08 = HAPPY
		10 = PANIC
		20 = BIND
		40 = SLEEP
		80 = SHOCK
	03 = STATUS
		00 = GOOD
		01 = FREEZE
		02 = CHARM
		04 = BAT
		08 = FLY
		10 = PALYZE
		20 = STONE
		40 = UNDEAD
		80 = DEAD/DYING
	04 = CHARACTER ID
		For humans:
		00 = Aleph
		01 = Hiroko
		02 = Beth
		03 = Gimmel
		04 = Daleth
		05 = Zayin
		06 = Aleph?
		>06 = glitch
	05 = Name offset?
		80 for humans
		00 for demons
	06 = ???
	08 = COMMAND
		#0 = blank
		#1 = SWD
		#2 = ATC
		#3 = GUN
		#4 = EXT
		#5 = COM
		#6 = MGC
		#7 = ITM
		#8 = RET
		#9 = DEF
		>#A = glitch
		(nibble 1 presumably encodes something, but don't know what)
	0A-0B = LEVEL
	0C-0F = EXP
	10-11 = CURHP
	12-13 = MAXHP (auto-calculated)
	14-15 = CURMP (always "..." for protag)
	16-17 = MAXMP
	19-1E = CORE STATS
	1F-24 = STAT BONUSES
	25-2A = STAT BONUSES
	2B-2F = STAT BONUSES
	31-37 = EQUIPMENT
	38 = AMMO
	39-3A = SWD ATK
		for humans, = (LV/4)+STR+WPN_ATK
	3B-3C = SWD HIT
		for humans, = LV+(LUK/2)+SPD+WPN_HIT
	3D-3E = (LV+STR)*2
		probably "physical power", whatever that is
		whatever it is, it is NOT the HP bonus
	3F-40 = (1.5LV+SPD)+(1/4)(STR+LUK)
		either general accuracy or advantage chance?
	41-42 = GUN ATK
		= WPN_ATK+BULLET_ATK+(LV/4)
	43-44 = GUN HIT
		= LV+(LUK/2)+SPD+WPN_HIT
	45-46 = DEF
		for demons, = LV+(STM*2)
	47-48 = EVA
		for demons, = 1.5LV+SPD+INT+(LUK/4)
	49-4A = MPW
	4B-4C = MEF
	4D = ???
	4E = alignment
	4F-54 = SKILLS (demons only)
	55 = ACTIVE SKILL
	56-60 = ???
$1000: PROTAG DATA
$1060: PARTNER DATA
$10C0: DMN1 DATA
$1120: DMN2 DATA
$1180: DMN3 DATA
$11E0: DMN4 DATA
$1240: DMN5 DATA
$12A0: DMN6 DATA
$1300: DMN7 DATA
$1360: DMN8 DATA
$13C0: DMN9 DATA
$1420: DMN10 DATA
$1480: DMN11 DATA
$14E0: DMN12 DATA

$1540: ENEMY1 / FUSION PREVIEW DATA
$15A0: ENEMY2 DATA
$1600: ENEMY3 DATA
$1660: ENEMY4 DATA
$16C0: ENEMY5 DATA
$1720: ENEMY6 DATA
$1780: ENEMY7 DATA
$17E0: ENEMY8 DATA
$1840: ENEMY9 DATA

$191E: PTR storage?

ROM:
$0394FA-$03A5D7: Tile event pointers (5 bytes)
	00: X coord
	01: Y coord
	02: Pointer (24bit) to event code

	$039B71: Fiend tile (Ark 52F)
	$03A15C: Earthquake tile

$03C981: status effect codes
	sequence is opposite order of listing in character data
$03D833: default protagonist name (Hawk)
$03DB14: bit check values
$03DB3F: treasure data (4 bytes)
	00: Xpos
	01: Ypos
	03: control value; determines if key, regular, or gem
	04: item ID#

$04C1B6-$04C570: Spell/skill data (6 bytes)
	00: element
		20 = sword
		22 = fire
		23 = ice
		24 = elec
		25 = force
		2B = rush
		2C = punch
		2D = kick
		2E = flying
		2F = support
		36 = nerve
		37 = exorcism
		38 = curse
		39 = magic
		3A = bind
		8F = teleport
		CF = Estoma
		EF = healing
	01: power
		not used for healing spells
	02: targeting type
		00 = single enemy
		01 = 2x hits
		05 = 2-3 random
		09 = 3-5 single
		0F = all enemies
		82 = afflicted ally
		EF = ally
		FF = all allies
	03: cost (% HP if skill)
	04-05: effect (matches codes in character data)
		if healing spell, cures effect
		multiple effects can be designated

$04CD4F: Subroutine that checks for stat doors in Kongokai (?)
	(direction)*0x40 || playerY -> $0808
	iterate over $04D027 (4-byte blocks)
		if n1 == playerX and n2 == $0808, it's a match
	n3,4 -> $0808
	n4 = SRT ID for $04CD96

$04CDE5: Unknown data

$04FF86: List of demon IDs that are ineligible for Russian Roulette (story-critical and Machines)
$04FFA7: List of demon IDs, purpose unknown (Machines starting with Iron Maiden)
$04FFA7: List of demon IDs, purpose unknown (Lucifer + all Machines)

$19D552: Demon data (32 bytes)
	(race is not stored here)
	00: Level
	01-02: HP
	03-04: MP
	05-0A: core stats
	0B: ???
	0C: unknown but looks suspiciously like a bit field
		not read by Devil Analyze
		not read in battle
	0D: Affinity Type
	0E: Number of attacks
	0F: AI type?
	10-16: Skills
		FF = blank
		(enemies can have an extra skill)
	17: ???
		not read by Devil Analyze
		sometimes read in battle?
	18.U: EXP multiplier
	18.L: item drop rate (sorta, weird math involved)
	19: item drop
	1A: Macca & MAG multiplier
	1B: CP
	1C: inheritance
		# matches order in affinity data
	1D: set to 01 to turn drop into gem
	1E: ???
		not read by Devil Analyze
	1F: ???
		not read by Devil Analyze
		usually 80 for demons, B0 for bosses

$19F552: Boss data (same format)

$218000: Events
	Events are structured similarly to opcode: each byte contains a value that corresponds to instructions for some action, some of which take arguments in the following bytes.
	
	$218000: Church
	$21807C: Temple
	$21811E: Repair Garage
	$21818D: Law spring
	$218223: Chaos spring
	$2182D5: Neutral spring
	$2183BA: Bar
	$2183E7: Bar chats
	$2186BD: Terminal
	$2186F7: Underworld Terminal
	$218731: Makai Terminal
	$218770: quit game
	$2187A5: Jakyo Manor
	$21D976: Terminal
	$21F025: Earthquake
		(followed by many earthquake events, some identical and some slightly different)
	$21F386: Fiend tile
	(see SMT2.diz for full list)

$3B8604: Generate enemy demon

$3B9D29: Enemy AI patterns? (8 bytes)
	iterate over block until RNG <= value
	(same RNG value used for all checks)
	if RNG <= value 1 or end of block reached, use regular attack; else, #iterations = skill used
	All blocks end with FF (guaranteed RNG success)
	So effectively, bytes 2-7 = chance to use respective skill; chance to attack = byte 1 + any remaining probability
	
	AI #00 -> can use 2 skills
	AI #01 -> can use 3 skills
	AI #02 -> can use 3 skills, low chance of attack
	AI #03 -> can use 5 skills, low chance of attack
	AI #04 -> can use 3 skills, high chance of attack
	AI #05 -> can use 4 skills
	AI #06 -> can use 3 skills, very high chance of attack
	AI #07 -> can use 6 skills
	AI #08 -> can use 6 skills, low chance of attack
	AI #09 -> can use 4 skills, 50% attack
	AI #0A -> can use 5 skills, very low chance of attack
	AI #0B -> can use 4 skills, high chance of attack
	AI #0C -> can use 6 skills, very low chance of attack
	AI #0D -> can use 5 skills
	AI #0E -> can use 6 skills, never (well, 1/256) attack
	AI #0F -> 50% attack, 50% skill 3
	AI #10 -> can use 6 skills
	
	An interesting consequence of this is that enemy demons with gaps in their skill lists (e.g. have a skill 6 but not a skill 5) can't use the later skills, with the exception of type #0F. Type #0F demonstrates this does not intrinsically need to be the case, they just never accounted for it in any other types.
	
$3B9DB1: Affinity types (8 bytes)
	Each nibble is 1 affinity
		8 = NEUTRAL
		7 = Rs 7/8
		6 = Rs 6/8
		5 = Rs 5/8
		4 = Rs 4/8
		3 = Rs 3/8
		2 = Rs 2/8
		1 = Rs 1/8
		0 = NULL
		9 = Wk x1.5
		A = Wk x2
		B = Wk x2.5
		C = Rf 1/2
		D = Rf
		E = Dr 1/2
		F = Dr
	00: SWD, GUN
	01: FIR, ICE
	02: ELC, FOR
	03: NRV, EXR
	04: CRS, MGC
	05: BND, RSH
	06: HND, LEG
	07: FLY, ALM

$7E3600-$7E361F: TREASURE TRACKER

Event codes:
00 = end event
01 = wait for input
02 = page
03 = unknown
04 = unknown
	arg: 8bit, unknown
	(seems to call Aleph's name)
05 = unknown
	arg: 8bit, unknown
	(seems to call Hiroko's name)
06 = yes/no prompt
	arg: 16bit, PTR to "no" handler
	("yes" advances to next instruction)
07 = print message
	arg: 16bit metapointer, = (offset from 228800) / 3
08 = jump
	arg: 16bit pointer
09 = set variable
	arg: 8bit, target variable
		byte is $(0E00+(n/8))
		bit is (n && 07)
0A = unset variable
	arg: 8bit, target variable
		byte is $(0E00+(n/8))
		bit is (n && 07)
0B = branch
	arg1: 8bit, target variable
	arg2: 16bit, PTR if flag set
		if flag NOT set, continue to next instruction
0C = conditional jump if no demon in active party with skill
	arg1: 8bit, skill ID
	arg2: 16bit, PTR
0D = load sprite
	arg1: 8bit, unknown
	arg2: 16bit, sprite ID
	arg3: 8bit, sprite Xpos
	arg4: 8bit, sprite Ypos
0E = remove sprite
	arg: 8bit, sprite ID in scene
0F = change background
	arg: 8bit
10 = set shop and jump to universal shop event
	arg: 8bit, shop ID
11 = change sound
	arg: 8bit
12 = pause
	arg: 8bit, time (frames?)
13 = set alignment
	arg: 8bit signed (Chaos positive, Law negative), amount
14 = branch based on alignment
	arg1: 16bit, jump address if Law
	arg2: 16bit, jump address if Chaos
	(if Neutral, continue to next instruction)
15 = branch if alignment falls within range
	arg1: 8bit, lower range
	arg2: 8bit, upper range
	arg3: 16bit, PTR if n1 < alignment < n2
16 = set demon
	arg: 8bit, ID
17 = set demon 2
	arg: 8bit, ID
1A = set active key item
	arg: 8bit, item ID
1C = obtain active item
1D = remove active item
1E = spawn demon sprite (center)
1F = spawn multiple demon sprites
20 = fade out sprite
21 = also fade out sprite? (frequently called after combat)
22 = initiate combat
23 = branch if active item not present
	arg: 16bit, PTR for branch
	if active item is NOT special, check against inventory
	else if ID < 20, check against key items
	else, check against gems (subtract 20 from active item variable)
24 = random jump
	arg1: 8bit, likelihood
		chance = 1 / 2^(n+1)
	arg2: 16bit, pointer to event
25 = change macca
	arg1: 24bit signed, amount
26 = branch if macca less than...
	arg1: 24bit, amount
	arg2: 16bit, PTR to event if macca < arg1
	(else, continue)
28 = call bar
	arg: 8bit, bar ID
29 = long jump
	arg: 24bit pointer
2A = refresh msg box
	arg: 8bit (01 = small, 00 = big)
2B = generate menu
	arg1: 8bit, (# options - 1)
	argX: menu option
		arg1: 8bit, label ID
		arg2: 16bit, PTR to linked event
	(must end with a default handler)
2C = teleport menu
	arg1: 16bit, PTR for default/cancel
	arg2: 16bit, PTR to regular Terminal
	arg3: 16bit, PTR to underworld Terminal
	arg4: 16bit, PTR to Makai Terminal
2D = pause
	arg: 8bit, time (frames?)
2E = reduce HP
	arg1: 8bit, target
		00 = Aleph
		01 = partner
		02 = both
		03 = all
	arg2: 8bit, % reduction in HP
30 = conditional jump (moon phase)
	arg1: 8bit, moon phase
		jump only if arg != phase
	arg2: 16bit, jump pointer
31 = branch if Aleph's INT < threshold
	arg1: 8bit, threshold
	arg2: 16bit, jump PTR
32 = branch if Aleph's MAG < threshold
	arg1: 8bit, threshold
	arg2: 16bit, jump PTR
33 = branch if Aleph's LV < threshold
	arg1: 8bit, level threshold
	arg2: 16bit, jump PTR
34 = branch if partner absent, Aleph or partner stoned/paralyzed, or partner HP too low (?)
	arg: 16bit, PTR
35 = branch if Aleph has status
	arg1: status (matches order in $03C981)
	arg2: 16bit, PTR
3B = jump if NOT facing direction
	arg: 8bit, direction (00 = N, etc.)
3E = set timer?
	arg: 16bit, # of moon cycles
3F = set text speed
	arg: 8bit, slowdown (higher = slower)
40 = inflict status
	arg1: 8bit, target
		00 = Aleph
		01 = partner
		02 = both
		03 = all
	arg2: 8bit, status
		#0 = DEAD
		#1 = UNDEAD
		#2 = STONE
		#3 = PALYZE
		#4 = FLY
		#5 = BAT
		#6 = CHARM
		#7 = FREEZE
		#8 = SHOCK
		#9 = SLEEP
		#A = BIND
		#B = PANIC
		#C = HAPPY
		#D = POISON
		#E = CLOSE
		#F = CURSE
41 = recover HP
	arg: 8bit, target
		00 = Aleph
		01 = partner
		02 = both
		03 = all
42 = recover MP
	arg: 8bit, target
		00 = Aleph
		01 = partner
		02 = both
		03 = all
43 = restore status (including death)
	arg: 8bit, target
		00 = Aleph
		01 = partner
		02 = both
		03 = all
44 = add demon to stock
	arg: 16bit, PTR for case if stock full
45 = unknown
	arg1: 8bit
	arg2: 8bit
46 = remove demon (set with code 0x16) from stock
47 = unknown
48 = branch if demon (set with code 0x16) is NOT in party
	arg: 16bit, PTR
4A = update viewport to current position
4B = show overworld background (?)
4C = heal HP/MP shop
	arg: 16bit, PTR to default handler
4D = heal status shop
	arg: 16bit, PTR to default handler
4E = revive shop
	arg: 16bit, PTR to default handler
4F = break curse shop
	arg: 16bit, PTR to default handler
50 = call current background, sprite, and overlay
51 = call shopkeeper dialogue
	arg: 8bit, determines dialogue
52 = item shop
53 = sell
	arg1: 8bit, unknown
	arg2: 16bit, PTR to default handler (player has no items)
54 = describe
55 = equip
56 = view status
57 = display item info
58 = clear overlay
59 = drinks
5A = chat
5B = set shop
	arg: 8bit, shop ID (corresponds to PTR in bank)
5C = set variable? (used for minigames and Virtual Battler)
	arg: 8bit
5E = summon overlay
	arg: 8bit, overlay type
5F = remove overlay
	arg: 8bit, overlay type
60 = teleport
	arg1: 8bit, destination Xpos
	arg2: 8bit, destination Ypos
	arg3: 8bit, destination skin
61 = branch if demon stock full
	arg: 16bit, PTR
62 = animation on
	arg: 8bit
63 = animation off
	arg: 8bit
64 = name entry
	arg1: 8bit, name ID (see $0310)
65 = fusion
	arg1: 8bit, fusion type
		00 = regular
		01 = triple
		02 = swd & demon
		03 = sword
		04 = 2swd & demon
69 = go to overworld
	arg1: 8bit, Xpos
		stores n1&&7F to $070A, n1&&80 to $0722
	arg2: 8bit, Ypos
		stores (n2+1)&&80 to $073A, (n2+1)&&7F to $070C
	arg3: 8bit, direction of movement
		00 = north, increments proceed clockwise
	$0738 = $0738||A000
6A = initialize virtual battler?
	stores Aleph & partner's curHP, curMP, and status to temp variables; resets status if not in good condition
6B = return from virtualspace
6C = summon demon from stock (to first empty slot, or slot 6 if full)
6D = branch if macca less than some value found in $03D6F4 data block?
	(($0613)*2 + $0612) && FF -> $0808
	(($056E && FF) * 4 + $0808) * 2 = offset for $03D6F4
	store to $057A
	if macca is >= this value, subtract it from macca
6E = pan screen
	arg1: 8bit, horizontal speed (left)
	arg2: 8bit, vertical slowdown (higher = slower)
	arg3: 8bit, duration of scroll?
	(standard scroll is 00 FF 70)
72 = add party member
	00 = Hiroko
	01 = Beth
	(higher numbers produce a character with Beth's name but different stats)
73 = set Aleph's name
	arg: 8bit, if != 00 source Hawk's name from ROM (hardcoded), else source from RAM
74 = minigame
	arg: 8bit, game type
75 = remove partner
	arg: 8bit, possibly ID but doesn't seem to matter
77 = special effect
	arg: 8bit
		00 = Mekata flashback
		01 = open Sealed Cavern
		02 = short delay + move foreground left
			(used for opening prison bars)
		04 = longer delay?
		05 = elevator up
		06 = elevator down
		07 = Moloch rises
		08 = observe Moloch
		09 = Steven in distance
		0A = blur
		0B = unblur
		0C = Ark launch 2 (Ark perspective)
		0D = Ark launch 2 (ground perspective)
		0E = Kuzuryu attacks Millenium
		0F = Gate of Judgment
		10 = Gate dismissed
		12 = Set awakens
		13 = Ark launch 1
		14 = Kuzuryu destroys Millenium
		15 = Megido Ark fires
		16 = Zayin fuses with Set
		17 = credits
		18 = fade to white
		19 = fade in from white
		1A = fade to black
		1B = fade in from black
		1C = Law ending
		1D = Neutral ending
		1E = Chaos ending
		1F = Nadja fusion
		20 = Astaroth separation
		21 = flash
		22 = slow fade to black
		23 = slow fade in
		24 = Masakado fusion
		25 = Terminal warp
		26 = remove GUI
		27 = Kuzuryuu wakes
78 = flicker
	arg: 8bit, target layer
79 = flicker off
7A = open door w/ special background
	arg: 8bit, unknown
		01 = watchtower gate
7E = set item
	arg: 8bit, ID
7F = draw box
	arg: 8bit, box type
		01 = open
80 = conditional jump (treasure): Checks if player X&Y match a treasure entry, then jumps if treasure obtained; else, continue. Also stores item data for use with code 81.
	arg: 16bit, PTR for jump
81 = add treasure to inventory; set treasure tracker
	current treasure must be set with code 80 first
	(also includes handlers for if inventory is full)
83 = save
85 = branch if inventory empty
	arg: 16bit, PTR
86 = numpad entry
87 = Casino shop
	arg1: 16bit, PTR for default (not enough coins)
	arg2: 16bit, PTR for default (inventory full)
	arg3: 16bit, PTR for cancel
89 = set enemy (boss?)
	arg: 8bit, ID
8B = fly through overworld
	arg1: 8bit, destination Xpos
	arg2: 8bit, destination Ypos
8C = gem trade (items)
8D = gem trade (elements)
8E = check $0E04, bit 7, and set a flag based on result (?)
	called at start of Terminal events, might be updating Terminals visited?
8F = branch if demon (set with 0x16) is in stock but NOT in active party
	arg: 16bit, PTR
90 = branch if all demons in party are ineligible for Russian Roulette
	(Nadja, O-yamatsumi, Sukuna-Hikona, Satan, Lucifer, all Machine/Vaccine/Viruses)
	arg: 16bit, PTR
91 = boosts Aleph's stats
	arg1: 4bit, stat index
	arg2: 4bit, amount

$2AABD0: Shop data
	shop lists consist of item IDs, terminated with FF
	2AABD0-2AAC16: PTRs to shop lists, 16bit
	2AAC18: Valhalla